package br.ufal.tci.nexos.arcolive.service.broker.command;

import br.ufal.tci.nexos.arcolive.ArCoLIVEServiceManager;
import br.ufal.tci.nexos.arcolive.command.ArCoLIVEClientCommand;
import br.ufal.tci.nexos.arcolive.command.ArCoLIVECommandResult;
import br.ufal.tci.nexos.arcolive.service.connection.ConnectionRequest;

public class StatusServiceCommand extends ArCoLIVEClientCommand {
	
	public StatusServiceCommand(ConnectionRequest request) {
		super(request);
	}
	
	public ArCoLIVECommandResult executeImpl() {
		int serviceId = this.request.getIntegerParameter("serviceId").intValue();
		int instanceId = this.request.getIntegerParameter("instanceId").intValue();
		int status = ArCoLIVEServiceManager.getInstance().statusOfService(serviceId, instanceId);
		return new ArCoLIVECommandResult(this, status);
	}

}